var mysql = require('mysql');
var connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: 'MyPass@123456',
    database: 'xcx'
});



module.exports = (sql) => {
    return  new Promise(next => {
        connection.connect();
        connection.query(sql, function (error, results, fields) {
            if (error) throw error;
            // console.log('The solution is: ', results[0].solution);
            next(results)
        });
        connection.end();
    })




}